/********************************************************************************
 * Project Name		[JavaSE_Fundamentals]
 * File Name     	[EnumTest1.java]
 * Creation Date 	[2015-01-01]
 * 
 * Copyright© ge.y.yang@gmail.com All Rights Reserved
 * 
 * Work hard, play harder, think big and keep fit
 ********************************************************************************/
package jdk5.enums;

/**
 * @author 不落的太阳(Sean Yang aka ShortPeace)
 * @version 1.0
 * @since jdk 1.8
 * 
 */
public class EnumTest1 {

	/**
	 * 定义一个枚举
	 * 
	 * @author 不落的太阳(Sean Yang aka ShortPeace)
	 * @version 1.0
	 * @since jdk 1.8
	 *
	 */
	enum Gender {
		MALE, FEMALE;
	}

	@SuppressWarnings("unused")
	public static void main(String[] args) {
		Gender male = Gender.MALE;
		Gender female = Gender.FEMALE;

		Gender man = Gender.MALE;
		Gender woman = Gender.FEMALE;
	}
}

/**
 * jdk 1.5之前的用户自定义的类似于枚举的类
 * 
 * @author 不落的太阳(Sean Yang aka ShortPeace)
 * @version 1.0
 * @since jdk 1.8
 *
 */
class Gender {

	private String value;

	public static final Gender MALE = new Gender("男");

	public static final Gender FEMALE = new Gender("女");

	private Gender(String value) {
		this.value = value;
	}

	public String getValue() {
		return this.value;
	}
}
